using System;
using System.Reflection;
using System.IO;
using NBody;
using NBody.Analysis;
using OptionParser;

[assembly: AssemblyTitle ("NBodyConvert")]
[assembly: AssemblyVersion ("1.0.*")]
[assembly: AssemblyDescription ("Convert to and from Dave's no header format")]
[assembly: AssemblyCopyright ("2005 Joseph D. MacMillan")]

public class ConvertOptions : InputOutputGetOptions
{
    [Option ("-I", "Input format")]
    public DataFormat.Type InFormat;
    
    [Option ("-O", "Output format")]
    public DataFormat.Type OutFormat;
    
    public ConvertOptions()
    {
        InFormat = DataFormat.Type.Basic;
        OutFormat = DataFormat.Type.Basic;
    }
}

public class NBodyConvert
{
    public static void Main(string[] args)
    {
        ConvertOptions opts = new ConvertOptions();
        opts.ProcessArgs(args, ".convert");
        
        NBodySystem s = DataFormat.Read(opts.InFile, opts.InFormat);
        DataFormat.Write(s, opts.OutFile, opts.OutFormat);
    }
}
